package com.vtest.mes.utils;

import java.io.File;

/**
 * @program: MesHelper
 * @author: tiger
 * @create: 2024-12-10 15:10
 * @Description : 文件工具类
 */

public class FileUtils {

    /**
     * @Description: 判断是否为目录
     * @Date 2024/12/10 15:13
     */
    public static boolean isDirectory(String path) {
        File directory = new File(path);
        if (directory.exists() && directory.isDirectory()) return true;
        return false;
    }

    /**
     * @Description: 判断是否为目录
     * @Date 2024/12/10 15:13
     */
    public static boolean isDirectory(File directory) {
        if (directory.exists() && directory.isDirectory()) return true;
        return false;
    }

    /**
     * @Description: 判断是否为文件
     * @Date 2024/12/10 15:13
     */
    public static boolean isFile(String path) {
        File file = new File(path);
        if (file.exists() && file.isFile()) return true;
        return false;
    }

    public static boolean isFile(File file) {
        if (file.exists() && file.isFile()) return true;
        return false;
    }
}
